package com.zerui.manager.web.enums;

import lombok.Getter;

/**
 * @Author wh
 * @create_time 2023-08-25 14:23
 */

@Getter
public enum DevicePassTypeEnum {

    FACE(1,"人脸签入"),
    PASSWORD(2,"密码签入"),
    SWIPE(3,"刷卡签入"),
    ID_CARD(4,"身份证签入"),
    FINGERPRINT(5,"指纹签入"),
    PEOPLE_EVIDENCE_UNITE(6,"人证合一"),
    PEOPLE_CARD_UNITE(7,"人卡合一"),
    PEOPLE_EVIDENCE_CONTRAST(8,"人证对比"),
    QR_CODE(9,"二维码签入"),
    REMOTE_DOOR_OPEN(10,"远程开门"),
    ;

    private final Integer code;

    private final String name;

    DevicePassTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code){
        DevicePassTypeEnum[] values = DevicePassTypeEnum.values();
        for (DevicePassTypeEnum passTypeEnum : values) {
            if(passTypeEnum.getCode().equals(code)){
                return passTypeEnum.getName();
            }
        }
        return null;
    }

}
